package com.nce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.orm.Page;
import org.springside.modules.orm.PropertyFilter;

import com.nce.dao.VpDao;
import com.nce.entity.Vp;

@Component
@Transactional
public class VpService {
	@Autowired
	private VpDao vpDao;

	public VpDao getVpDao() {
		return vpDao;
	}

	public void setVpDao(VpDao vpDao) {
		this.vpDao = vpDao;
	}

	public Vp getVp(Long id) {
		return vpDao.get(id);
	}

	public Page<Vp> findVp(Page<Vp> page, List<PropertyFilter> filters) {
		return vpDao.findPage(page, filters);
	}

	public void saveVp(Vp entity) {
		vpDao.save(entity);
		
	}

	public void deleteVp(Long id) {
		vpDao.delete(id);
		
	}

	public void saveVpList(List<Vp> vpList) {
		for(Vp vp : vpList){
			vpDao.save(vp);
		}
		
	}

	public void deleteAllVP() {
		List<Vp> vpList = vpDao.getAll();
		for(Vp vp : vpList){
			vpDao.delete(vp);
		}
		
	}

	public List<Vp> findAllVp() {
		return vpDao.getAll();
	}

	public List<Vp> findVpList(List<PropertyFilter> filters ) {
		return vpDao.find(filters);
	}

	
}
